Repository navigation
feat(watch): gameplay watcher slices reference frames into tmp - #5
Merged
Merged
Conversation
The authoring agent can read a card and still not know what the motion looks like. `npm run watch -- "<words>"` searches YouTube, downloads one segment with yt-dlp, and slices evenly spaced frames plus a 3-column contact sheet into a mkdtemp folder, with watch.json naming the video, the segment and every frame time. Defaults learned from the first live run: the window opens 10% into the video, because 0% is the title card and the file menu; seeks are relative to the segment because yt-dlp rebases a downloaded section to zero. Frames stay in tmp and never reach data/: they are someone else's footage, while cards cite source code at the pinned SHA.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
npm run watch -- "super mario 64 triple jump" --duration 25 --frames 6searches YouTube for agameplay video of a mechanic reference, downloads one segment, and slices frames plus a contact
sheet into a tmp folder for the authoring agent to look at.
scripts/watch.mjs— one file, no dependencies beyondyt-dlpandffmpegon PATH.--pick N,--from(seconds,mm:ss,hh:mm:ss, orNN%of the video),--duration,--frames N,--at 12,35,61,--out DIR,--keep.frames/NN-tSECONDSs.jpg(640px),sheet.jpg(one image, all frames in order),watch.json(video, segment, frame times). The clip is deleted unless--keep.Why the defaults are what they are
The first live run opened on the SM64 title screen and the file-select menu: 6 frames of Mario's
face and no mechanic. Two fixes came out of it, both in this PR: the default window opens 10% into
the video, past the intro, and seeks are relative to the segment because yt-dlp rebases a
downloaded section to zero (the absolute seek silently produced zero frames).
Verification
npm test44/44, including 9 new checks intests/watch.spec.mjswith fakeyt-dlp/ffmpegbinaries: manifest contents, frame names, the relative seek, non-empty
--outrefusal.--at 5,8 --keep.npm run check:data— 48 catalog rows, 48 games, unchanged.Not included
No ffmpeg-skill vendoring: it is a 42-script editing toolkit for delivering video, and this needs
-ss,-frames:vandtile. No scene-change selection (even sampling answers the need, and thefirst sheet exists to decide where to look next), no YouTube API key, no vision model.